package com.helen.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.helen.entity.ArticleEntity;
import com.helen.shopping.R;
import com.helen.utils.ImageLoadUtil;
import com.helen.utils.MyLog;

import java.util.List;


/**
 * Created by yang on 2018/4/23.
 */

public class SaleAdapter extends BaseQuickAdapter<ArticleEntity, BaseViewHolder> {

    public SaleAdapter(int layoutResId, List<ArticleEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(final BaseViewHolder helper, final ArticleEntity item) {
        try {
            ImageView img = (ImageView) helper.getView(R.id.img);
            TextView tvName = (TextView) helper.getView(R.id.tv_name);
            ImageLoadUtil.displayImage(mContext, img, item.getImg(), R.mipmap.app_logo, R.mipmap.app_logo);
            tvName.setText(item.getTitle());
        } catch (Exception e) {
            MyLog.e("yang", "特价活动列表异常" + e.toString());
        }


    }


}
